home *** CD-ROM | disk | FTP | other *** search
- Path: news.rain.org!usenet
- From: "Guus Leeuw jr." <guusl@eiffel.com>
- Newsgroups: comp.lang.c++
- Subject: Re: C++ and lex?
- Date: Wed, 24 Jan 1996 15:56:03 -0800
- Organization: ISE Inc. http://www.eiffel.com
- Message-ID: <3106C713.7D8CBABC@eiffel.com>
- References: <4dugkp$fl8@apakabar.cc.columbia.edu>
- NNTP-Posting-Host: @outback.eiffel.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b3 (X11; I; Linux 1.2.8 i586)
- CC: guusl
-
- Paul E Gunnells wrote:
- >
- > Hello everyone:
- >
- > Has anyone ever tried using lex along with iostream.h to handle input?
- > Or better yet, is there some equivalent to lex that works well with
- > C++?
-
- I never tried it, though, but my man page for `flex' tells me that it is
- possible. It's still experimental in my version (2.5.2). It tells that
- the C++ counterpart is able to handle `istream' and `ostream' classes.
-
- >
- > Of course, one solution is to have an extern C function yylex() that
- > just returns tokens that your C++ program deals with, but a better
- > solution (at least a cleaner solution) would be a version of lex that
- > allows you to directly incorporate C++ code (streams, constructors)
- > into the lex source.
- >
- > Is there such a beast?
-
- Assuming a UNIX(like) environment: try `man flex' or `flex++ --version'.
- It will you more.
-
- If you're, for some reason, not able to `flex', I can get you a copy of
- the man-page part that tells about C++, and a copy of the distributors
- via e-mail, if you want to. Just contact me.
-
- >
- > Paul Gunnells
-
- Regards,
- Guus Leeuw jr.
- guusl@eiffel.com
-